package gew.data;

import java.io.Serializable;
import java.sql.ResultSet;
import java.sql.SQLException;

public class MenuItem implements Serializable {

    public static final Integer SQL_NAME = 0;
    public static final Integer SQL_URL = 1;
    private final String name;
    private final String urlCode;
    private String url = "#";
    private Integer aggregateLevel;
    private boolean isMore = false;

    public MenuItem(String name, String urlCode) {
        this.name = name;
        this.urlCode = urlCode;
    }

    public MenuItem(String name, String urlCode, boolean isMore) {
        this.name = name;
        this.urlCode = urlCode;
        this.isMore = isMore;
    }

    public MenuItem(ResultSet rs) throws SQLException {
        name = rs.getString(1);
        urlCode = rs.getString(2);
        aggregateLevel = rs.getInt(3);
    }

    public String getName() {
        return name;
    }

    public String getUrlCode() {
        return urlCode;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public Integer getAggregateLevel() {
        return aggregateLevel;
    }

    public boolean isIsMore() {
        return isMore;
    }
}
